/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DBConnections;

/**
 *
 * @author aeguzkiza
 */

import DBConnections.MySQL_Query;
import java.sql.ResultSet;
import java.sql.SQLException;

public class ServerData {
    // Loading libraries
    MySQL_Query DB = new MySQL_Query();

    private ResultSet rs;

    private String ServerHost;
    private String ServerAETitle;
    private String ServerPort;

    public ServerData(Integer Id) throws SQLException{
        // SERVER DATA:
        rs = DB.SQLquery("SELECT * FROM server WHERE Id="+Id);
        rs.first();
        this.ServerHost = rs.getString("HostIP");
        this.ServerAETitle = rs.getString("AETitle");
        this.ServerPort = Integer.toString(rs.getInt("HostPort"));

        //System.out.println("ServerHost: "+ServerHost+"\nServerAETitle: "+ServerAETitle+"\nServerPort: "+ServerPort+"\n");


    }
    public String getServerHost(){
        return this.ServerHost;
    }    
    public String getServerAETitle(){
        return this.ServerAETitle;
    }
    public String getServerPort(){
        return this.ServerPort;
    }
}
